Skip to content

Conversation

jamallaqdiem
Copy link

@jamallaqdiem jamallaqdiem commented Jul 31, 2025

Learners, PR Template

Self checklist

  • I have committed my files one by one, on purpose, and for a reason
  • I have titled my PR with Region | Cohort | FirstName LastName | Sprint | Assignment Title
  • I have tested my changes
  • My changes follow the style guide
  • My changes meet the requirements of this task

Changelist

Fixed the errors and the broken codes in the the script.js to make it work as intended.

Questions

Ask any questions you have for your reviewer.

@jamallaqdiem jamallaqdiem added Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. 📅 Sprint 2 Assigned during Sprint 2 of this module labels Jul 31, 2025
Copy link
Contributor

@cjyuan cjyuan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Doing so can help me speed up the review process. Thanks.

  • The Self-checklist in the PR description is not checked.

@cjyuan cjyuan added Reviewed Volunteer to add when completing a review with trainee action still to take. and removed Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. labels Aug 8, 2025
…js to handle and pass all criteria requested, answering questions in form of comments.
@jamallaqdiem jamallaqdiem added the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Aug 10, 2025
return false;
} else {
let book = new Book(title.value,author.value, pages.value, check.checked);
let book = new Book(inputTitle.value,inputAuthor.value, pagesToNumber, check.checked);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

On line 46, the raw title/author input could contain leading/trailing space characters, and pageToNumber can be a number with decimal places.

To reduce the chance of using raw input accidently, we could stored the pre-processed/sanitized/normalized input in some variables first, and reference the variables in other part of the function.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for reviewing, I just stored the sanitized variables before suing them before creating the Book object.

Comment on lines 86 to 92
let readStatus = "";
if (myLibrary[i].check == true) {
readStatus = "Yes";
} else {
readStatus = "No";
}
changeBut.innerText = readStatus;
changeReadStatusBtn.textContent = readStatus;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This could be a good chance to practice using the ? : conditional operator. We could rewrite the code on lines 86-92 as one statement.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for reviewing, you're write much better and concise to do using ternary operator.

@cjyuan cjyuan removed the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Aug 10, 2025
@jamallaqdiem jamallaqdiem added the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Aug 10, 2025
@cjyuan
Copy link
Contributor

cjyuan commented Aug 10, 2025

Changes look good! Well done.

@cjyuan cjyuan added Complete Volunteer to add when work is complete and all review comments have been addressed. and removed Reviewed Volunteer to add when completing a review with trainee action still to take. Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. labels Aug 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Complete Volunteer to add when work is complete and all review comments have been addressed. 📅 Sprint 2 Assigned during Sprint 2 of this module

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants